package com.df.tank.designPattern.singleton;

/**
 * 懒汉式
 * 按需确定是否实例化
 * 有线程安全问题
 */
public class Singleton02 {
    private static Singleton02 instance = null;
    private Singleton02() {
    }

    public static Singleton02 getInstance() {
        if (instance == null) {
            instance = new Singleton02();
        }
        return instance;
    }
}
